Elasticsearch-->java REST Client API Overview:
Elasticsearch provides the rest web API, so developers can call Elasticsearch in their own restful web
For a detailed description of the
), "G3czOt4HQbKZT1RhpPCULw", PvHtEMuRSJ6rLJ27AW3U6w"), new CancelAllocationCommand(new ShardId("‘library", 2), "G3czOt4HQbKZT1RhpPCULw", true)) .execute().actionGet();Node Information APIThe node information (nodes information) API provides information for one or more specific nodes. The A
Java API implementationsJar Package Import Please refer to the previous blog Elasticsearch 5.X under the Java API Usage guideWrite a test class:Package Esjavapia5;Import Java. NET. InetAddress;Import
ElasticSearch JAVA API Official document: Https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-docs-index.htmlFirst, generate JSONThe first step in creating an ind
document that deletes an index named blog with a type of Article,id 1:DeleteResponse dResponse = client.prepareDelete("blog", "article", "1").execute().actionGet();
1
2
by Deleteresponse the Isfound () method of the object, you can get the success of the deletion, and the return value is a Boolean type.Third, delete through queryelasticsearch-2.3 and older APIs are not the same, install plugins:delete-by-query
1
When a cluster has multiple nodes, each node needs
blog with a type of Article,id 1:DeleteResponse dResponse = client.prepareDelete("blog""article""1").execute().actionGet();by Deleteresponse the Isfound () method of the object, you can get the success of the deletion, and the return value is a Boolean type.Third, delete through queryelasticsearch-2.3 and older APIs are not the same, install plugins:delete-by-queryDelete the index named Twitter, with all documents of type Tweet,user field containing kimchy:DELETE /twitter/tweet/_query?q=user:ki
This Learning note comes from the ES official website's Guidance document: ES JAVA API Client client is a class that enables various operations on the ES cluster: Index, GET, Delete, Search , as well as management tasks for ES clusters. Client constructs need to be based on the transportclient transportclient transportclient can remotely connect ES clusters through a transmission module, but it is not r
processing index. If you need to put a string as a whole to be indexed, this field needs to be set: Field ("Index", "not_analyzed").Index data /** * Bulk Index */@Test public void Indexdata () {Bulkrequestbuilder Requestbuilder = Client.preparebu LK (); for (person person:personlist) {String obj = getindexdatafromhotspotdata (person); if (obj! = null) {Requestbuilder.add (Client.prepareindex ("Test_index", "Test", String.valueof (Person.getid ())) . Setrefresh (T
]View PlainCopy
Searchhits hits = Myresponse.gethits ();
for (int i = 0; i
System.out.println (Hits.gethits () [I].getsourceasstring ());}
It can also use Hits.gethits () [I].getsource (), which is a map format that can be displayed in detailThird, the implementation of other APIs during the searchWhen we read the DSL, we can see that the query has a lot of queries, such as multi-domain, such as filtering query conditions, the following for the
].getsourceasstring ());}
It can also use Hits.gethits () [I].getsource (), which is a map format that can be displayed in detailThird, the implementation of other APIs during the searchWhen we read the DSL, we can see that the query has a lot of queries, such as multi-domain, such as filtering query conditions, the following for the Elasticsearch server development of some basic query DSL given in the Java
ElasticSearch java API-use More like this to implement Content-based recommendation
ElasticSearch java API-use More like this to implement Content-based recommendation
Content-based recommendations generally give a document inform
/releasesTo download the version of the ES that you are using
IK version ES version
master 2.1.1-> master
1.7.0 2.1.1
1.6.1 2.1.0 1.5.0 2.0.0
1.4.1 1.7.2
1.4.0 1.6.0
1.3.0 1.5.0 1.2.9 1.4.0 1.2.8 1.3.2
1.2.7 1.2.1
1.2.6 1.0.0
1.2.5 0.90.x
1.1.3 0.20.x
1.1.2 0.19.x
1.0.0 0.16.2-> 0.19.0As shown above, individuals believe that a version of the high will be compatible with the low version
After the download is complete, unpack and then package using MVN package, where you need to install MAVEN,
1, full-text query overview
Https://www.elastic.co/guide/en/elasticsearch/client/java-api/6.1/java-full-text-queries.html
The high-level full text queries are usually used to running full text queries on full text fields like the ' body of ' an EM Ail. They understand how the field being queried are analyzed and would
The Elasticsearch query is to construct the QueryBuilder object in the Java API by executing the query criteria in JSON format, Elasticsearch fully supports the QUERYDSL style query, The QueryBuilder build class is the Querybuilders,filter build class is filterbuilders. The following is an example of constructing Query
Reprint: Http://m.blog.csdn.net/u012546526/article/details/74184769Elasticsearch Java API Common query Methods QueryBuilder Construction Example Environment Elasticsearch version5.1.1PomDependency> groupId>Org.elasticsearchgroupId> Artifactid>ElasticsearchArtifactid> version>5.1.1version>Dependency>Elasticsearch
Java official documentation for the main reference el: https://www.elastic.co/guide/en/elasticsearch/client/java-api/1.7/generate.html
A blog: http://www.cnblogs.com/huangfox/p/3543134.html
Elasticsearch Official Guide: http://es.xiaoleilu.com/010_Intro/30_Tutorial_Search.ht
Elasticsearch is a Lucene-based search server. It provides a distributed multi-user-capable full-text search engine, based on a restful web interface. Elasticsearch is developed in Java, as the current popular enterprise-class search engine, used in cloud computing , can achieve real-time search, and has a stable, reliable, fast installation, ease of use and many
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.